package action;

import parser.AddParser;
import core.Utility;
import data.Event;

public class Archive extends Action
{

	@Override
	public Event[] execute(String userCommand) {
		String params = userCommand.replace(Utility.getHead(userCommand), "");
		Event archivedEvent = AddParser.parseEvent(params);
		archivedEvent.setTicked(true);
		return new Find().find(archivedEvent);
	}

	@Override
	public Event[] undo() {
		return null;
	}

	@Override
	public boolean isUndoable() {
		return false;
	}

	@Override
	public String errorMessage() {
		return "You have not done anything :-\\";
	}

	@Override
	public String getCommandName() {
		return "archive";
	}
}
